<!DOCTYPE html>
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>新闻列表管理页</title>
    <link rel="stylesheet" th:href="@{/assets/css/styles.css}">
    <link rel="stylesheet" th:href="@{/assets/css/colors.css}">
    <script th:src="@{/assets/js/jquery.min.js}"></script>
    <script th:src="@{/assets/js/popper.min.js}"></script>
    <script th:src="@{/assets/js/bootstrap.min.js}"></script>
    <script th:src="@{/assets/js/custom.js}"></script>
    <script th:src="@{/assets/js/daterangepicker.js}"></script>
    <script th:src="@{/assets/js/dropzone.js}"></script>
    <script th:src="@{/assets/js/imagesloaded.js}"></script>
    <script th:src="@{/assets/js/ion.rangeSlider.min.js}"></script>
    <script th:src="@{/assets/js/jquery.magnific-popup.min.js}"></script>
    <script th:src="@{/assets/js/lightbox.js}"></script>
    <script th:src="@{/assets/js/markerclusterer.js}"></script>
    <script th:src="@{/assets/js/moment.min.js}"></script>
    <script th:src="@{/assets/js/morris.min.js}"></script>
    <script th:src="@{/assets/js/raphael.min.js}"></script>
    <script th:src="@{/assets/js/select2.min.js}"></script>
    <script th:src="@{/assets/js/slick.js}"></script>
    <script th:src="@{/assets/js/slider-bg.js}"></script>
    <script th:src="@{/assets/js/script.js}"></script>
</head>
<body>
    <!-- 复用首页头部 -->
    <header th:replace="index::header"></header>
    <!-- 提示框信息 -->
    <div th:replace="point-modal::modal"></div>
    <!-- 当前用户发布的所有房源信息 -->
    <div class="container" style="margin-bottom: -20px; height: 695px; overflow: auto">
        <section class="p-0">
            <div class="container-fluid p-0">
                <div class="row">
                    <!-- 左侧导航栏 -->
                    <div th:replace="sidebar::left"></div>
                    <!-- 右侧内容 -->
                    <div class="col-lg-9 col-md-8 col-sm-12"  style="height:695px;overflow:auto;">
                        <div class="dashboard-body">
                            <table class="property-table-wrap responsive-table bkmark" style="margin-top: -10px;margin-bottom: -30px;">
                                <tbody>
                                <tr>
                                    <th>标题/摘要</th>
                                    <th>时间</th>
                                    <th>操作</th>
                                </tr>
                                </tbody>
                                <!-- 循环显示新闻信息 -->
                                <tr th:each="news:${newsList}" th:if="${newsList != null}">
                                    <td>
                                        <div th:text="${news.title}" style="font-weight: bold; margin-top: -25px;"></div>
                                        <div th:text="${news.summary}"
                                             style="margin-bottom: -20px; height: 45px; width: 450px;
                                                    word-break: break-all; display: -webkit-box; text-overflow: ellipsis;
                                                    -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;">
                                        </div>
                                    </td>
                                    <td>
                                        <span th:text="${#calendars.format(news.createTime, 'yyyy-MM-dd')}"></span>
                                    </td>
                                    <td style="display: flex">
                                        <div style="border: 1px solid #c6afaf; border-radius: 5px; margin-bottom: 1px; margin-right: 20px; width: 50px; text-align: center">
                                            <a th:href="@{/news/publishNewsPage(newsId = ${news.id})}" style="color: #0f7dff">编辑</a>
                                        </div>
                                        <div style="border: 1px solid #c6afaf; border-radius: 5px; margin-bottom: 1px; margin-right: 20px; width: 50px; text-align: center">
                                            <a href="javascript:void(0)" th:onclick="|deleteNews(${news.id})|" style="color: red">删除</a>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <!-- 分页 -->
                            <nav class="mt-5" th:if="${page.rows>0}" th:replace="index::pagination"></nav>
                        </div>
                    </div>

                </div>
            </div>
        </section>
    </div>
    <!-- 复用首页底部 -->
    <div th:replace="index::footer"></div>

    <script>
        $(function () {
            $("#newsManage").attr("class", "active");
        })
    </script>
</body>
</html>